package com.moonee.cluser.controller;

import com.moonee.Entity.User;
import com.moonee.clapi.userInterface.UserInfoInterface;
import com.moonee.cluser.feign.CommentApi;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@RestController
public class UserInfoController implements UserInfoInterface {
    
    @Autowired
    private CommentApi commentApi;
    
    @RequestMapping("/getUserInfo")
    public User getUserById(String name) {
        User user = new User();
        user.setUserName(name);
        user.setPassword(name+"123456");
        return user;    
    }

    @RequestMapping("/getUserByTimeOut")
    public User getUserByTimeOut(String name) {
        User user = new User();
        user.setUserName(name);
        //Comment com = commentApi.getCommentTimeOut("hahahha");
        user.setPassword(name+"123456");
        try {
            Thread.sleep(2000);
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
        System.out.println("user服务"+user.toString());
        return user;
    }
    

    
    
}
